﻿#pragma once

#include <QPointer>
#include <QMouseEvent>

#include "QtScrcpyCoreDef.h"

namespace qsc {


class IDevice : public QObject
{
    Q_OBJECT
public:
    IDevice(QObject * parent = nullptr) : QObject(parent) {}
    virtual ~IDevice() {}

public:

    virtual bool isReversePort(quint16 port) = 0;
    virtual const QString & getSerial() = 0;
};

class IDeviceManage : public QObject
{
    Q_OBJECT
public:
    static IDeviceManage & getInstance();
    virtual bool connectDevice(DeviceParams params) = 0;
    virtual bool disconnectDevice(const QString & serial) = 0;
    virtual void disconnectAllDevice() = 0;
    virtual QPointer<IDevice> getDevice(const QString & serial) = 0;

signals:
    void deviceConnected(bool success, const QString & serial, const QString &deviceName, const QSize & size);
    void deviceDisconnected(QString serial);
};
}
